<template>
  <div class="container">
    <div class="title">
      <img src="@/assets/images/portal_title.png" alt="">
    </div>
    <div class="content">
      <div
        v-for="(item, index) in unifyPortalSystem"
        :key="item.name"
        class="content-item"
        @mouseenter="mouseenter(index)"
        @mouseleave="mouseleave(index)"
      >
        <img
          :src="
            require(`@/assets/images/${item.log}${
              item.isHover ? '_hover' : ''
            }.png`)
          "
          alt=""
        >
        <div class="content_title">{{ item.name }}</div>
        <p>{{ item.desc }}</p>
        <el-button type="primary" @click="jump(item.url)">进入专题</el-button>
      </div>
    </div>
  </div>
</template>
<script>
import getEnv from '@/utils/env'
export default {
  data() {
    return {
      unifyPortalSystem: [
        {
          log: 'gongxiangjiaohuan',
          name: '共享交换平台',
          desc: '政务数据共享交换通道，实现政务数据跨地域、部门、系统、业务的信息资源共享交换',
          isHover: false,
          key: 'VUE_APP_JUYE_PORTAL_SHARE_EXCHANGE_URL'
        },
        {
          log: 'shujuzhongtai',
          name: '数据中台',
          desc: '一体化数据综合治理平台，挖掘数据价值，助力城市治理数智化',
          isHover: false,
          key: 'VUE_APP_JUYE_PORTAL_BIGDATA_URL'
        },
        {
          log: 'BIkeshihua',
          name: 'BI可视化平台',
          desc: '可视化开放平台，支持报表、驾驶舱大屏等数据应用的敏捷构建和高效分析',
          isHover: false,
          key: 'VUE_APP_JUYE_PORTAL_BI_URL'
        },
        {
          log: 'shujutianbaoxitong',
          name: '数据填报系统',
          desc: '简单、快捷、高效、统一的智能填报系统',
          isHover: false,
          key: 'VUE_APP_JUYE_PORTAL_DATA_FILLING_URL'
        }
      ]
    }
  },
  created() {
    this.clientHeight = document.body.clientHeight
    this.getDefaultUrl()
  },
  methods: {
    getDefaultUrl() {
      const cloneArr = [...this.unifyPortalSystem]
      this.unifyPortalSystem = cloneArr.map((item) => {
        return {
          ...item,
          url: getEnv(item.key)
        }
      })
    },
    jump(url) {
      window.open(url)
    },
    mouseenter(index) {
      this.unifyPortalSystem[index].isHover = true
    },
    mouseleave(index) {
      this.unifyPortalSystem[index].isHover = false
    }
  }
}
</script>
<style lang="scss" scoped>
.container {
  width: 100%;
  height: 100%;
  background-image: url("../../assets/images/unifyportal.png");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  overflow-y: auto;
  .title {
    text-align: center;
    margin: 7% 0;
  }
  .content {
    width: 100%;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    .content-item {
      width: 280px;
      height: 400px;
      border-radius: 4px;
      background: #ffffff;
      display: flex;
      flex-direction: column;
      align-items: center;
      margin-right: 20px;
      margin-bottom: 20px;
      padding: 55px 23px 46px 23px;
      img {
        width: 80px;
        height: 80px;
      }
      .content_title {
        color: #000000cc;
        font-family: Source Han Sans CN;
        font-weight: bold;
        font-size: 24px;
        line-height: 33.33px;
        letter-spacing: 0px;
        text-align: center;
        margin: 15px 0;
      }
      p {
        height: 88px;
        color: #000000a5;
        font-family: Source Han Sans CN;
        font-weight: regular;
        font-size: 16px;
        line-height: 24px;
        letter-spacing: 0px;
        text-align: center;
      }
    }
    .content-item:hover {
      background: #147eeb;
      .content_title {
        color: #ffffff;
      }
      p {
        color: #ffffff;
      }
      .el-button--primary {
        color: #0066ff;
        background-color: #ffffff;
      }
    }
  }
}
</style>
